/**
 * 
 */
package xj.toolkit.ebus.unit;

import xj.toolkit.ebus.EventBus;

/**
 * @author hp
 *
 */

/*
org.springframework.context.support 
Class GenericApplicationContext
java.lang.Object
  org.springframework.core.io.DefaultResourceLoader
      org.springframework.context.support.AbstractApplicationContext
          org.springframework.context.support.GenericApplicationContext
All Implemented Interfaces: 
BeanFactory, DisposableBean, HierarchicalBeanFactory, ListableBeanFactory, BeanDefinitionRegistry, ApplicationContext, ApplicationEventPublisher, ConfigurableApplicationContext, Lifecycle, MessageSource, AliasRegistry, ResourceLoader, ResourcePatternResolver 
Direct Known Subclasses: 
GenericWebApplicationContext, ResourceAdapterApplicationContext, StaticApplicationContext 

--------------------------------------------------------------------------------

public class GenericApplicationContextextends AbstractApplicationContextimplements BeanDefinitionRegistryGeneric ApplicationContext implementation that holds a single internal DefaultListableBeanFactory instance and does not assume a specific bean definition format. Implements the BeanDefinitionRegistry interface in order to allow for applying any bean definition readers to it. 

Typical usage is to register a variety of bean definitions via the BeanDefinitionRegistry interface and then call AbstractApplicationContext.refresh() to initialize those beans with application context semantics (handling ApplicationContextAware, auto-detecting BeanFactoryPostProcessors, etc). 

In contrast to other ApplicationContext implementations that create a new internal BeanFactory instance for each refresh, the internal BeanFactory of this context is available right from the start, to be able to register bean definitions on it. AbstractApplicationContext.refresh() may only be called once. 

Usage example: 

 GenericApplicationContext ctx = new GenericApplicationContext();
 XmlBeanDefinitionReader xmlReader = new XmlBeanDefinitionReader(ctx);
 xmlReader.loadBeanDefinitions(new ClassPathResource("applicationContext.xml"));
 PropertiesBeanDefinitionReader propReader = new PropertiesBeanDefinitionReader(ctx);
 propReader.loadBeanDefinitions(new ClassPathResource("otherBeans.properties"));
 ctx.refresh();

 MyBean myBean = (MyBean) ctx.getBean("myBean");
 ...For the typical case of XML bean definitions, simply use ClassPathXmlApplicationContext or FileSystemXmlApplicationContext, which are easier to set up - but less flexible, since you can just use standard resource locations for XML bean definitions, rather than mixing arbitrary bean definition formats. The equivalent in a web environment is XmlWebApplicationContext. 
For custom application context implementations that are supposed to read special bean definition formats in a refreshable manner, consider deriving from the AbstractRefreshableApplicationContext base class. 



Since: 
1.1.2 
Author: 
Juergen Hoeller 
See Also:
registerBeanDefinition(java.lang.String, org.springframework.beans.factory.config.BeanDefinition), AbstractApplicationContext.refresh(), XmlBeanDefinitionReader, PropertiesBeanDefinitionReader
*/

public interface EventUnit {
    public Object   init(EventBus eventBus);
    public void     destroy(Object ctx);
    public String   getDescription();
}
